<%@page import="com.je180503.service.NewsTypeService"%>
<%@page import="com.je180503.service.impl.NewsTypeServiceImpl"%>
<%@page import="com.je180503.pojo.NewsType"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>


    <title>My JSP 'add.jsp' starting page</title>

    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="This is my page">
    <!--
    <link rel="stylesheet" type="text/css" href="styles.css">
    -->

</head>

<body>
<form action="doadd.jsp" method="post">

    <table border="1px">
        <tr>
            <td>类别名称:</td>
            <td><input type="text" name="typeName"/></td>
        </tr>
        <tr>
            <td>父类别:</td>
            <td>
                <select name="parentId">
                    <option value="0">==顶级类别==</option>
                    <%

                        NewsTypeService newsTypeService=new NewsTypeServiceImpl();

                        List<NewsType> topList=newsTypeService.getTopNewsTypeList();

                        for(int i=0;i<topList.size();i++){
                    %>
                    <option value="<%=topList.get(i).getId()%>"><%=topList.get(i).getTypeName() %></option>
                    <%} %>
                </select>
            </td>
        </tr>

        <tr>

            <td colspan="2" align="center"><input type="submit" value="新增新闻类别"></td>
        </tr>

    </table>

</form>
</body>
</html>

